// 文章相关组件的公共样式
// 用于 ArticleDetail.vue, ArticlePreview.vue, ArticleEdit.vue

// 基础布局样式
.article-detail {
  min-height: calc(100vh - 64px);
  padding-bottom: 10px;
}

.article-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  gap: 1rem;
  align-items: flex-start;
}

.main-content {
  flex: 1;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.5rem;
}

// 加载和错误状态
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem;
  color: #666;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error {
  text-align: center;
  padding: 4rem 2rem;
  color: #666;
}

.error h2 {
  color: #e74c3c;
  margin-bottom: 1rem;
}

.back-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 1rem;
}

// 文章头部样式
.article-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.breadcrumb {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #97dc99;
}

.breadcrumb-link {
  color: #97dc99;
  text-decoration: none;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  margin: 0 0.5rem;
}

.breadcrumb-current {
  color: #ffffff;
  font-weight: 500;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

// 元数据样式
.article-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-label {
  color: #97dc99;
  font-weight: 600;
}

.meta-value {
  color: #ffffff;
  font-weight: 700;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.meta-status {
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

.meta-status.published {
  background: #88c057;
  color: #ffffff;
}

.meta-status.draft {
  background: #fff3cd;
  color: #856404;
}

.meta-status.archived {
  background: #f8d7da;
  color: #721c24;
}

// 操作按钮样式
.article-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.action-btn.secondary {
  background: #6c757d;
  color: white;
}

.action-btn.secondary:hover:not(:disabled) {
  background: #5a6268;
}

.action-btn.info {
  background: #17a2b8;
  color: white;
}

.action-btn.info:hover:not(:disabled) {
  background: #138496;
}

.action-btn.primary {
  background: linear-gradient(135deg, #0098ff 0%, #4fc1ff 100%);
  color: #ffffff;
  font-weight: 600;
}

.action-btn.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 122, 204, 0.6);
}

// 文章正文样式
.article-body {
  margin-bottom: 2rem;
}

.content {
  line-height: 1.8;
  color: #e0e0e0;
  font-size: 1.1rem;
}

// Markdown 内容样式
.content :deep(h1) {
  font-size: 2rem;
  margin: 2rem 0 1rem 0;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 3px solid;
  border-image: var(--gradient-rainbow) 1;
  padding-bottom: var(--spacing-sm);
  position: relative;
  filter: drop-shadow(0 0 10px rgba(92, 225, 255, 0.3));
}

.content :deep(h1)::before {
  content: '🌟 ';
  -webkit-text-fill-color: var(--color-accent-yellow);
  filter: drop-shadow(0 0 10px rgba(255, 235, 59, 0.6));
}

.content :deep(h2) {
  font-size: 1.6rem;
  margin: 1.5rem 0 1rem 0;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  padding-left: 1rem;
  font-weight: 700;
}

.content :deep(h2)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--gradient-warm);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-glow-green);
}

.content :deep(h3) {
  font-size: 1.3rem;
  margin: 1.2rem 0 0.8rem 0;
  color: var(--color-accent-orange);
  font-weight: 700;
}

.content :deep(h3)::before {
  content: '⚡ ';
  color: var(--color-accent-yellow);
  margin-right: 0.3rem;
  filter: drop-shadow(0 0 8px rgba(255, 235, 59, 0.6));
}

.content :deep(p) {
  margin-bottom: 1rem;
}

.content :deep(code) {
  background: linear-gradient(135deg, #2d1f3f 0%, #1e1e1e 100%);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: #ff6b9d;
  border: 1px solid rgba(255, 107, 157, 0.2);
  font-weight: 500;
}

.content :deep(pre) {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 1.2rem;
  border-radius: 8px;
  border-left: 4px solid;
  border-image: linear-gradient(180deg, #4fc1ff 0%, #88c057 100%) 1;
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: 0 4px 15px rgba(0, 152, 255, 0.2);
  position: relative;
}

.content :deep(pre)::before {
  content: '💻 Code';
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 0.75rem;
  color: #88c057;
  font-family: 'Segoe UI', sans-serif;
  opacity: 0.7;
}

.content :deep(pre code) {
  background: none;
  padding: 0;
  display: block;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.5;
}

.content :deep(ul) {
  margin: 1rem 0;
  padding-left: 2rem;
}

.content :deep(li) {
  margin-bottom: 0.7rem;
  position: relative;
  color: #e8e8e8;
}

.content :deep(li)::marker {
  color: var(--color-accent-orange);
  font-size: 1.3em;
}

.content :deep(strong) {
  font-weight: 700;
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(255, 235, 59, 0.4));
}

.content :deep(em) {
  font-style: italic;
  color: #a8dadc;
  font-weight: 500;
}

.content :deep(a) {
  color: var(--color-primary-light);
  text-decoration: none;
  border-bottom: 2px solid rgba(92, 225, 255, 0.4);
  transition: all var(--transition-normal);
  font-weight: 600;
}

.content :deep(a):hover {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom-color: var(--color-secondary);
  filter: drop-shadow(0 0 12px rgba(160, 226, 95, 0.6));
}

.content :deep(blockquote) {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid #88c057;
  background: linear-gradient(135deg, rgba(136, 192, 87, 0.1) 0%, rgba(79, 193, 255, 0.05) 100%);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #d0d0d0;
}

.content :deep(blockquote)::before {
  content: '"';
  font-size: 3rem;
  color: #88c057;
  opacity: 0.3;
  position: absolute;
  margin-left: -1rem;
  margin-top: -1rem;
}

.content :deep(hr) {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, #97dc99, transparent);
  margin: 2rem 0;
}

.content :deep(img) {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin: 1rem 0;
}

// 文章底部样式
.article-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1rem;
}

.tags {
  margin-bottom: 0.5rem;
}

.tag {
  display: inline-block;
  background: linear-gradient(135deg, rgba(92, 225, 255, 0.2) 0%, rgba(160, 226, 95, 0.2) 100%);
  color: var(--color-primary-light);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  margin-right: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  border: 1px solid rgba(92, 225, 255, 0.4);
  font-weight: 600;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
}

.tag:hover::before {
  left: 100%;
}

.tag:hover {
  background: var(--gradient-rainbow);
  color: var(--text-white);
  border-color: var(--color-accent-yellow);
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-glow-rainbow);
}

// 相关文章样式
.related-articles {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem;
}

.related-articles h3 {
  font-size: 1.3rem;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  text-align: center;
  border-bottom: 2px solid;
  border-image: var(--gradient-rainbow) 1;
  padding-bottom: 0.3rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.related-list.scrollable {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.related-list.scrollable::-webkit-scrollbar {
  width: 6px;
}

.related-list.scrollable::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.related-list.scrollable::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.related-list.scrollable::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.related-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.related-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(79, 193, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.related-item:hover::before {
  left: 100%;
}

.related-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(151, 220, 153, 0.3);
  border-color: #97dc99;
}

.related-item h4 {
  font-size: 0.95rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.related-item p {
  color: #e0e0e0;
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.no-related {
  color: #666;
  font-style: italic;
}

// 侧边栏样式
.sidebar-content {
  width: 380px;
  position: sticky;
  top: 2rem;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

// 响应式设计
@media (max-width: 768px) {
  .article-layout {
    flex-direction: column;
    padding: 1rem;
    gap: 0.8rem;
  }
  
  .main-content {
    max-width: 100%;
    padding: 1rem;
  }
  
  .sidebar-content {
    width: 100%;
    position: static;
  }
  
  .desktop-only {
    display: none;
  }
  
  .mobile-only {
    display: block;
  }
  
  .article-title {
    font-size: 2rem;
  }
  
  .article-meta {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .article-actions {
    flex-direction: column;
  }
  
  .action-btn {
    justify-content: center;
  }
}
